import { h, resolveComponent } from 'vue'
export default {
    functional: true,
    render(ctx) {
        // console.log(ctx,'h.datah.data777')
        const data = ctx.$,
            dataAttrs = ctx.$attrs,
            tag = dataAttrs.tag;
        if (!tag) return;
        let children = dataAttrs.children ? dataAttrs.children : null;
        // console.log(children,'typeof children')
        if (typeof children === "function") children = children.call(ctx.$parent,h);
        const scopedSlots = { ...dataAttrs.scopedSlots },
        on = { ...dataAttrs.on, ...data.on },
        domProps = { ...dataAttrs.domProps, ...data.domProps },
        nativeOn = { ...dataAttrs.nativeOn, ...data.nativeOn },
        attrs = { ...dataAttrs.attrs, ...dataAttrs.props, tag: null, children: null, scopedSlots: null, on: null, domProps: null, nativeOn: null };
        // console.log(children,'scsxc2123')
        // console.log(data.attrs,'datadatadata3333')
        return h(
            tag!='div'?resolveComponent(tag):tag,
            // {
            //     ...data.attrs,
            //     attrs,
            //     scopedSlots,
            //     on,
            //     domProps,
            //     nativeOn
            // },
            {
                ...data.attrs,
                ...data.attrs.domProps,
                // ...data.attrs.style,
                // ...data.children,
                // ...scopedSlots,
                // onClick:data.attrs.on,
                // onInput: data.attrs.onInput,
                // ...domProps,
                // ...nativeOn
            },
            { default: () => [children] }
            // [children]
        );
    }
};
